# coding=utf-8
# author:xc
# datetime:2018/10/23 19:00

from . import api
from dbConnection.MysqlConn import Mysql
from app import util, upload_files
from flask import request


@api.route('/api/news/share', methods=['POST', 'GET'])
@util.verify_login
def api_news_share(uid):
    title = request.values.get('title')
    typeId = request.values.get('typeId')  # 定位类型
    shareType = request.values.get('shareType')  # 分享类型
    ip = util.get_current_ip()
    mysql = Mysql()

    if int(typeId) == 1:
        new_id = request.values.get('new_id')
        new_res = mysql.getOne("select * from new_list where id='%s'" % new_id, None)
        url = new_res['url']
    elif int(typeId) == 2:
        pass
    elif int(typeId) == 3:
        pass
